package main

import (
	"awesomeProject/application"
	"awesomeProject/config"
	"awesomeProject/logger"
	"time"
)

var lg = logger.InitLog()

func main() {

	application.InitFun()
	lg.Info("程序初始化")
	// 使用一个定时器通道
	moniter := config.LoadMoniterTime()

	ticker := time.NewTicker(time.Duration(moniter) * time.Second)
	defer ticker.Stop()

	// for {
	// 	select {
	// 	case <-ticker.C:
	// 		fmt.Println("定时任务执行啦！")
	// 		run1()
	// 	}
	// }
	lg.Info("程序运行")
	for range ticker.C {
		lg.Info("定时任务执行啦！")
		application.RunFunc()
	}

}
